<template>
    <div class="zhengji">
        <el-table :data="tableData" stripe style="width: 100%" height="500" border>
            <el-table-column prop="id" label="作品id" width="80" fixed/>
            <el-table-column prop="title" label="标题" width="150"></el-table-column>
            <el-table-column prop="createTime" label="创建时间" ></el-table-column>
            <el-table-column prop="accountNumber" label="对标账号" width="100"/>
            <el-table-column prop="earnestMoney" label="征稿金额" width="80"/>
            <el-table-column label="我的操作" fixed="right" width="200">
                <template #default="scope">
                    <el-button type="primary" @click.stop="toDetail(scope.row)">查看</el-button>
                    <el-button type="danger" @click.stop="del(scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    import {WorksCallupList,MyWorksCallupList} from "../../api/dsp/WorksCallupList";
    import {WorksCallupDel} from "../../api/WorksCallup";

    export default {
        name: "zhengji",
        data(){
          return{
              tableData:[],
          }
        },
        created(){
            this.getList()
        },
        methods:{

            getList(){
                MyWorksCallupList({creationTypeId:1}).then(res=>{
                    console.log('jieguo',res)
                    this.tableData=res.data.list
                })
            },

            toDetail(row){
                console.log('李炎',row)
                this.$router.push({path:'/dsp/zjDetailPublisher',query:{id:row.id}})
            },
            del(row){

                WorksCallupDel({id:row.id}).then(res=>{
                    if(res.code == 0){
                        this.$message.success(res.data)
                        this.getList()
                    }else{
                        this.$message.error(res.data)
                    }
                })

            },
        }
    }
</script>

<style scoped>

</style>
